package 刷题10月.脑筋急转弯类型;
// https://leetcode-cn.com/problems/moving-stones-until-consecutive/
public class 脑筋急转弯1033移动石子直到连续1007 {
    class Solution {
        public int[] numMovesStones(int a, int b, int c) {
            int t;
            if(a>b){t=a;a=b;b=t;}
            if(a>c){t=a;a=c;c=t;}
            if(b>c){t=b;b=c;c=t;}   //将最小值给a，最大值给c
            if(a==b-1&&a==c-2)  //a，b，c相邻无法移动
            {return new int[]{0,0};}
            if(b==a+1||c==b+1||b==a+2||b==c-2)  //有两个数相邻或相近（隔一位）注意我们上面已经排除了3个数相邻情况
            {return new int[]{1,c-a-2};}
            return new int[]{2,c-a-2};  //其他情况
        }
    }

}
